﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EVEBatteryCheck.Data {
    public class SeqDataManager {

        private List<int> listSeq = new List<int>();

        private object lockJumpSeq = new object();
        public void AddSeq(int seq) {
            lock (lockJumpSeq) {
                listSeq.Add(seq);
            }
        }
        public void AddSeqs(List<int> seqs) {
            lock (lockJumpSeq) {
                listSeq.AddRange(seqs);
            }
        }
        public bool CheckAndRemoveSeq(int seq) {
            lock (lockJumpSeq) {
                if (listSeq.Contains(seq)) {
                    listSeq.Remove(seq);
                    return true;
                }
            }
            return false;
        }

        public bool ClearSeq() {
            lock (lockJumpSeq) {
                listSeq.Clear();
            }
            return false;
        }
    }

}
